package com.itany.corejava.day04;

import java.util.Scanner;

public class Test1 {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);

        System.out.println("x=");
        int x=sc.nextInt();

        //后面使用Integer，这里等于0不合理，y还没计算不应该有值
        int y=0;

        if(x<-1){
            y=x*x-1;
        }

        if(-1<=x && x<=1){
            y=Math.abs(x)+1;
        }

        if(x>1){
            y=3*x+3;
        }

        System.out.println("y = " + y);








    }

}
